home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / dev / amos / PrgCollection.lha / Drops.AMOS / Drops.amosSourceCode
Encoding:
AMOS Source Code  |  1994-03-12  |  1.7 KB  |  76 lines

  1. ' *************************************
  2. ' *                                   *
  3. ' *            Drops V1.0             *  
  4. ' *      Written by Chris Hodges      *
  5. ' *                                   *
  6. ' *************************************
  7. '
  8. ' Dieses Programm simuliert Farbtropfen
  9. ' Es sind Bilder bis 16 Farben erlaubt.  
  10. ' Au�erdem k�nnen die Farben der Tropen ge�ndert werden (siehe unten). 
  11. '
  12. Screen Open 1,320,16,32,0
  13. Flash Off : Screen Hide 1
  14. Screen Open 0,320,256,32,0
  15. Curs Off : Flash Off : Paper 0 : Cls 0
  16. Cls 31 : Ink 32 : Circle 7,7,8
  17. Paint 8,8
  18. Bar 0,0 To 15,7
  19. Get Block 1,0,0,16,16
  20. Load Iff "Test16.iff"
  21. Screen 1 : Get Palette 0 : Screen 0 : For A=0 To 31 : Colour A,0 : Next 
  22. Screen 1
  23. For A=0 To 15
  24.   C=Colour(A)
  25.   Colour A+16,C
  26.   ' Hier k�nnen f�nf vorgegebene Routinen benutzt werden:  
  27.   ' Gosub HALFBRIGHT: Verdunkelt das Bild  
  28.   ' Gosub INVERS    : Invertiert alle Farben   
  29.   ' Gosub BLACKWHITE: Grautonbild    
  30.   ' Gosub ZERO      : Alles schwarz  
  31.   ' Gosub BLOOD     : Blut!
  32.   Gosub BLOOD
  33.   Colour A,C
  34. Next 
  35. Fill Logbase(4) To Logbase(4)+(Screen Width/8)*Screen Height,-1
  36. Dim F(31)
  37. Randomize Timer
  38. For A=0 To 19
  39.   F(A)=-16
  40. Next 
  41. Screen 0 : Fade 3 To 1
  42. A=0 : D=20
  43. Do 
  44.   Repeat : A=Rnd(19) : Until F(A)<256 and F(A)>-17
  45.   Put Block 1,A*16,F(A),%10000,%10000000
  46.   Add F(A),Rnd(3)+1
  47.   If F(A)>255 Then F(A)=-30 : Dec D
  48.   Exit If D=0
  49. Loop 
  50. End 
  51. INVERS:
  52.   C=$FFF-C
  53. Return 
  54. ZERO:
  55.   Colour A+16,0
  56. Return 
  57. HALFBRIGHT:
  58.   R=(C and $F00)/$100
  59.   G=(C and $F0)/$10
  60.   B=C and $F
  61.   C=(R/3)*$100+(G/3)*$10+(B/3)
  62. Return 
  63. BLOOD:
  64.   R=(C and $F00)/$100
  65.   G=(C and $F0)/$10
  66.   B=C and $F
  67. '  C=(R/3)*$100+(G/3)*$10+(B/3)
  68.   Colour A+16,C
  69.   C=Min(R+8,15)*$100+G*$10+B
  70. Return 
  71. BLACKWHITE:
  72.   R=(C and $F00)/$100
  73.   G=(C and $F0)/$10
  74.   B=C and $F
  75.   C=(R+G+B)/3*$111
  76. Return